home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
001-025
/
disk_024
/
csh
/
main.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-05-06
|
763b
|
51 lines
/*
* MAIN.C
*
* Matthew Dillon, 28 Apr 1986
*
* el main routine.
*/
#include "shell.h"
char Inline[256];
main(argc, argv)
char *argv[];
{
char *prompt;
int i;
init_vars();
init();
for (i = 1; i < argc; ++i) {
strcpy (Inline, "source ");
strcat (Inline, argv[i]);
do_source (Inline, 0);
}
for (;;) {
if ((prompt = get_var (LEVEL_SET, V_PROMPT)) == NULL)
prompt = "echo -n \"% \"";
++H_stack;
exec_command (prompt);
--H_stack;
fflush (stdout);
if (gets (Inline) == NULL)
exit (0);
if (*Inline)
exec_command (Inline);
}
}
init()
{
}
init_vars()
{
set_var (LEVEL_SET, V_PROMPT, "echo -n \"% \"");
set_var (LEVEL_SET, V_HIST, "20");
}